#include "InfosMoves.h"

InfosMoves::InfosMoves()
{
	currentPlayer = -1;
	pawnsTurnedDownList.clear();
	regularMovesList.clear();
}



//Ajoute un pion à la liste des pions retournés
void InfosMoves::addPawnsTurnedDown(Move m)
{
	pawnsTurnedDownList.push_back(m);
}



//Sauvegarde les coups réguliers
void InfosMoves::saveRegularMoves(vector<Move> v)
{
	regularMovesList = v;
}



//Sauvegarde le joueur courrant
void InfosMoves::saveCurrentPlayer(int id)
{
	currentPlayer = id;
}



//Accesseur de la variable 'currentPlayer'
int InfosMoves::getCurrentPlayer()
{
	return currentPlayer;
}


		
//Accesseur de la variable 'pawnsTurnedDownList'
vector<Move> InfosMoves::getPawnsTurnedDownList()
{
	return pawnsTurnedDownList;
}


		
//Accesseur de la variable 'regularMovesList'
vector<Move> InfosMoves::getRegularMovesList()
{
	return regularMovesList;
}



//Retourne la taille de pawnsTurnedDownList
int InfosMoves::getSizePawnsTurnedDownList()
{
	return pawnsTurnedDownList.size();
}


//Retourne la taille de regularMovesList
int InfosMoves::getSizeRegularMovesList()
{
	return regularMovesList.size();
}


//Retourne le move i de regularMoveList
Move InfosMoves::getRegularMovesList(int i)
{
	Move m;
	if( i>=0 && i<regularMovesList.size() )
	{
		m = regularMovesList[i];
	}
	return m;
}


//Retourne le move i de pawnsTurnedDownList
Move InfosMoves::getPawnsTurnedDownList(int i)
{
	Move m;
	if( i>=0 && i<pawnsTurnedDownList.size() )
	{
		m = pawnsTurnedDownList[i];
	}
	return m;
}




//Affichage console
void InfosMoves::affichage()
{
	cout << "\t Joueur courrant: ";
	if( currentPlayer == p1 )
		cout << "Black" << endl;
	else
		cout << "White" << endl;
	
	cout << "\t Pions retournés:" << endl;
	for( int i=0 ; i<pawnsTurnedDownList.size() ; i++ )
		pawnsTurnedDownList[i].affichage();
	
	cout << "\t Coups Réguliers:" << endl;
	for( int i=0 ; i<regularMovesList.size() ; i++ )
		regularMovesList[i].affichage();
	cout << "## Fin de InfosMoves ##" << endl;
}
